#include "com_example_cydiaadinsertapp_JniCMD.h"
#include <stdlib.h>
#include <stdio.h>

#ifdef __cplusplus
extern "C"
{
#endif
/*
 * Class:     com_example_cydiaadinsertapp_JniCMD
 * Method:    runCmd
 * Signature: (Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_com_example_cydiaadinsertapp_JniCMD_runCmd
  (JNIEnv *env, jclass arg, jstring cmd){
	const jbyte *str;
	str = (*env)->GetStringUTFChars(env, cmd, NULL);

	char intent[1024] = {0};
	sprintf(intent, str);
	system(intent);
}

/*
 * Class:     com_example_cydiaadinsertapp_JniCMD
 * Method:    test
 * Signature: (Ljava/lang/String;)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_com_example_cydiaadinsertapp_JniCMD_test
  (JNIEnv *env, jclass arg, jstring cmd){
	return  (*env)->NewStringUTF(env,"Test JNI!");

}


#ifdef __cplusplus
}
#endif
